﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraBars;
using DevExpress.XtraBars.Ribbon;
using DevExpress.XtraBars.Helpers;
using DevExpress.Skins;
using DevExpress.LookAndFeel;
using DevExpress.UserSkins;
using DevExpress.XtraTab;
using DevExpress.XtraEditors;
using DevExpress.XtraSplashScreen;
namespace ServiceOTOForm
{
    public partial class RibbonForm1 : DevExpress.XtraBars.Ribbon.RibbonForm
    {
        public RibbonForm1()
        {
            InitializeComponent();
            SkinHelper.InitSkinGallery(ribbonGalleryBarItem1, true);
        }

        private void RibbonForm1_Load(object sender, EventArgs e)
        {
            
        }
        private void OpenForm(XtraTabControl tc, XtraForm f)
        {
            DevExpress.XtraEditors.PanelControl pn = new DevExpress.XtraEditors.PanelControl();


            f.Show();
            f.Dock = DockStyle.Fill;
            f.FormBorderStyle = FormBorderStyle.None;
            f.TopLevel = false;
            pn.Controls.Add(f);
            pn.Dock = DockStyle.Fill;
            XtraTabPage p = new XtraTabPage();
            p.Controls.Add(pn);
            p.Text = f.Name;
            tc.TabPages.Add(p);
            tc.SelectedTabPage = p;
        }

        private void barButtonItem1_ItemClick(object sender, ItemClickEventArgs e)
        {
            splashScreenManager1.ShowWaitForm();
            XtraForm F = new Hangxe();
            OpenForm(xtraTabControl1, F);
            splashScreenManager1.CloseWaitForm();
        }

        private void xtraTabControl1_CloseButtonClick(object sender, EventArgs e)
        {
            if (xtraTabControl1.SelectedTabPageIndex != 0)
            {
                xtraTabControl1.TabPages.RemoveAt(xtraTabControl1.SelectedTabPageIndex);
            }
        }

        private void barButtonItem2_ItemClick(object sender, ItemClickEventArgs e)
        {
            splashScreenManager1.ShowWaitForm();
            XtraForm F = new  Form1();
            OpenForm(xtraTabControl1, F);
            splashScreenManager1.CloseWaitForm();
        }

        private void btnPhieuXuat_ItemClick(object sender, ItemClickEventArgs e)
        {
            splashScreenManager1.ShowWaitForm();
            XtraForm F = new PHIEUXUAT();
            OpenForm(xtraTabControl1, F);
            splashScreenManager1.CloseWaitForm();
        }

        private void barButtonItem3_ItemClick(object sender, ItemClickEventArgs e)
        {
            splashScreenManager1.ShowWaitForm();
            XtraForm F = new  THONGTINHNHACUNGCAP();
            OpenForm(xtraTabControl1, F);
            splashScreenManager1.CloseWaitForm();
        }

        private void barButtonItem4_ItemClick(object sender, ItemClickEventArgs e)
        {
            splashScreenManager1.ShowWaitForm();
            XtraForm F = new THONGTINXE();
            OpenForm(xtraTabControl1, F);
            splashScreenManager1.CloseWaitForm();
        }

    }
}